/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.service.members;
import com.qinyeit.serviceapp.entity.MemberCard;
import com.qinyeit.serviceapp.entity.VipRecord;
import com.qinyetech.springstage.core.entity.search.Searchable;
import com.qinyetech.springstage.core.lang.QyMap;
import com.qinyetech.springstage.core.service.IBaseService;
import com.qinyeit.serviceapp.entity.Member;
import org.springframework.data.domain.Page;

import java.util.List;

/** 
 * ClassName: MemberService <br/> 
 * Function: 会员信息业务功能 <br/> 
 * date: 2018-12-04 11:16:11 <br/> 
 * 
 * @author liuwenjin
 * @version 1.0
 * @since JDK 1.8
 */
public interface MemberService extends IBaseService<Member, Long>{

    /**
     * 保存 或 编辑 会员
     * @param vipMap 会员信息
     * @param merchantGroupId
     * @param branchName 入会门店
     * @return
     */
    Member updateMember(QyMap vipMap, Long merchantGroupId,String branchName);

    /**
     * 获取持卡数量
     * @return
     */
    Long getCardCount(Long memberId,Long merchantGroupId);

    /**
     * 获取会员 会员卡情况
     * @param id
     * @return
     */
    List<MemberCard> getMemberCard(Long id,Long merchantGroupId);

    /**
     * 获取会员操作记录
     * @param id
     * @param merchantGroupId
     * @return
     */
    Page<VipRecord> getVipRecord(Long id, Long merchantGroupId,Searchable searchable);

    /**
     * 根据会员卡号查询会员信息 （会员ids）
     * @param no 会员卡号
     * @return
     */
    List<Long> getIdsByCardNo(String no,Long merchantGroupId);
}